class EditionsGenre < ActiveRecord::Base
  #Relations
  belongs_to	:edition
  belongs_to	:genre

  #Callbacks
  after_create :create_edit

  #Validations
  validates_associated :edition
  validates_associated :genre

  private

  #
  #
  def create_edit
    entry = Hash.new
    entry.store("linked genre", [self.genre.name])
    Edit.create_edit(entry, self.edition)
  end

end
